
</div> <!-- end div containerContent -->
<!-- START OF FOOTER -->

<div id="footer">




</div>
</div>
<?php
$zlib_on = ini_get('zlib.output_compression');

if (empty($zlib_on)) {
?>
<script type="text/javascript" src="<?php echo $CFG->wwwroot ?>/lib/editor/tinymce3/tiny_mce_gzip.js"></script>
<script type="text/javascript">
tinyMCE_GZ.init({
	plugins : 'style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,'+ 
        'searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,moodleimage,moodlelink,dragmath,inlinepopups,dompdf',
	themes : 'advanced',
	languages : 'en',
	disk_cache : true,
	debug : false
});
</script>
<?php
} else {
?>
<script type="text/javascript" src="<?php echo $CFG->wwwroot ?>/lib/editor/tinymce3/tiny_mce.js"></script>
<?php
}
?>
<script language="javascript" type="text/javascript">
<?php
if (!empty($COURSE->id) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $COURSE->id))) {
?>
	tinyMCE.init({
		relative_urls : false,
        remove_script_host : true,
        document_base_url : "<?php echo $CFG->wwwroot; ?>",
		editor_selector : "form-textarea",
		mode : "textareas",
		theme : "advanced",
		convert_newlines_to_brs : false,
		force_br_newlines : true,   //CZW added 
		plugins : "safari,spellchecker,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,moodleimage,moodlelink,dragmath",
		
		theme_advanced_buttons1_add : "fontsizeselect,forecolor,backcolor,dragmath",
		
		theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,replace,separator,ltr,rtl,separator",
		theme_advanced_buttons2_add: "fullscreen",
		theme_advanced_buttons3_add_before : "tablecontrols,separator",
		theme_advanced_buttons3_add : "moodleimage,emotions,iespell,media,advhr",
		theme_advanced_disable : "help,underline,image",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		moodleimage_course_id: <?php echo $COURSE->id; ?>,
		theme_advanced_resize_horizontal : true,
		theme_advanced_resizing : true,
		file_browser_callback : "moodlefilemanager",
		apply_source_formatting : true
//CZW added 		forced_root_block : ''   
		
	
	});
    function moodlefilemanager(field_name, url, type, win) {
			
  	          tinyMCE.activeEditor.windowManager.open({
               file : "<?php echo $CFG->wwwroot ?>/lib/editor/tinymce3/plugins/moodlelink/link.php?id=<?php echo $COURSE->id; ?>",
               width : 480,  
               height : 380,
               resizable : "yes",
               inline : "yes",  
               close_previous : "no"
           }, {
               window : win,
               input : field_name
           });
           return false;
    }
<?php
} else {
?>
	tinyMCE.init({
		relative_urls : false,
        remove_script_host : true,
        document_base_url : "<?php echo $CFG->wwwroot; ?>",
		editor_selector : "form-textarea",
		mode : "textareas",
		theme : "advanced",
		convert_newlines_to_brs : false,
		force_br_newlines : true,  //CZW added
		plugins : "safari,spellchecker,style,layer,table,advhr,advimage,advlink,emotions,iespell,inlinepopups,preview,media,searchreplace,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,dragmath",
		
		theme_advanced_buttons1_add : "fontsizeselect,forecolor,backcolor,dragmath",
		
		theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,replace,separator,ltr,rtl,separator",
		theme_advanced_buttons2_add: "fullscreen",
		theme_advanced_buttons3_add_before : "tablecontrols,separator",
		theme_advanced_buttons3_add : "emotions,iespell,media,advhr",
		theme_advanced_disable : "help,underline",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		moodleimage_course_id: <?php echo $COURSE->id; ?>,
		theme_advanced_resize_horizontal : true,
		theme_advanced_resizing : true,
		apply_source_formatting : true
//CZW added 		forced_root_block : ''   
		
	});

<?php
}
?>
</script>

</body>
</html>
